package cn.springcloud.fix.es.controller;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ExecuteTaskRunnable implements Runnable {

    private int num;

    public ExecuteTaskRunnable(int i) {
        this.num = i;
    }

    @Override
    public void run() {
        System.out.println("ExecuteTaskRunnable:" + this.num);
        ExecutorService executorService = Executors.newFixedThreadPool(2);
        for (int i = 1; i < 10; i++) {
            executorService.execute(new TaskRunnable(this.num * 10 + i));
        }
        executorService.shutdown();
    }
}
